package com.jy.modules.cims.component.common.service;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jy.modules.cims.data.common.dao.TCMmFundsBorrowerBankactDao;
import com.jy.modules.cims.data.common.dto.TCMmFundsBorrowerBankactDTO;
import com.jy.platform.core.common.BaseDTO;

/**
 * @classname: TCMmFundsBorrowerBankactService
 * @description: 定义  T_C_MM_FUNDS_BORROWER_BANKACT 实现类
 * @author:  jieyue
 */
@Service("com.jy.modules.cims.component.common.service.TCMmFundsBorrowerBankactService")
public class TCMmFundsBorrowerBankactService implements Serializable {

    private static final long serialVersionUID = 1L;
    
	@Autowired
	private TCMmFundsBorrowerBankactDao dao;

	/**
     * @author jieyue
     * @description: 分页查询 T_C_MM_FUNDS_BORROWER_BANKACT列表
     * @date 2017-05-05 15:56:57
     * @param searchParams 条件
     * @return
     * @throws
     */ 
	public List<TCMmFundsBorrowerBankactDTO> searchTCMmFundsBorrowerBankactByPaging(Map<String,Object> searchParams) throws Exception {
		List<TCMmFundsBorrowerBankactDTO> dataList =  dao.searchTCMmFundsBorrowerBankactByPaging(searchParams);
		return dataList;
	}
	/**
     * @author jieyue
     * @description: 按条件查询T_C_MM_FUNDS_BORROWER_BANKACT列表
     * @date 2017-05-05 15:56:57
     * @param searchParams 条件
     * @return
     * @throws
     */
	public List<TCMmFundsBorrowerBankactDTO> searchTCMmFundsBorrowerBankact(Map<String,Object> searchParams) throws Exception {
	    List<TCMmFundsBorrowerBankactDTO> dataList = dao.searchTCMmFundsBorrowerBankact(searchParams);
        return dataList;
    }
	/**
     * @author jieyue
     * @description: 查询T_C_MM_FUNDS_BORROWER_BANKACT对象
     * @date 2017-05-05 15:56:57
     * @param id
     * @return
     * @throws
     */ 
	public TCMmFundsBorrowerBankactDTO queryTCMmFundsBorrowerBankactByPrimaryKey(String id) throws Exception {
		
		TCMmFundsBorrowerBankactDTO dto = dao.findTCMmFundsBorrowerBankactByPrimaryKey(id);
		
		if(dto == null) dto = new TCMmFundsBorrowerBankactDTO();
		
		return dto;
		
	}

	/**
     * @title: insertTCMmFundsBorrowerBankact
     * @author jieyue
     * @description: 新增 T_C_MM_FUNDS_BORROWER_BANKACT对象
     * @date 2017-05-05 15:56:57
     * @param dto
     * @return
     * @throws
     */
	@SuppressWarnings("all")
	public Long insertTCMmFundsBorrowerBankact(TCMmFundsBorrowerBankactDTO dto) throws Exception {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("dto", dto);
		
		int count = dao.insertTCMmFundsBorrowerBankact(paramMap);
		
		TCMmFundsBorrowerBankactDTO resultDto = (TCMmFundsBorrowerBankactDTO) paramMap.get("dto");
		Long keyId = resultDto.getId();
		return keyId;
	}
	/**
     * @title: updateTCMmFundsBorrowerBankact
     * @author jieyue
     * @description: 修改 T_C_MM_FUNDS_BORROWER_BANKACT对象
     * @date 2017-05-05 15:56:57
     * @param paramMap
     * @return
     * @throws
     */
	public void updateTCMmFundsBorrowerBankact(TCMmFundsBorrowerBankactDTO dto) throws Exception {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("dto", dto);
		
		dao.updateTCMmFundsBorrowerBankact(paramMap);
	}
	/**
     * @title: deleteTCMmFundsBorrowerBankactByPrimaryKey
     * @author jieyue
     * @description: 删除 T_C_MM_FUNDS_BORROWER_BANKACT,按主键
     * @date 2017-05-05 15:56:57
     * @param paramMap
     * @throws
     */ 
	public void deleteTCMmFundsBorrowerBankactByPrimaryKey(BaseDTO baseDto,String ids) throws Exception {
		if(StringUtils.isEmpty(ids)) throw new Exception("删除失败！传入的参数主键为null");
		
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("dto", baseDto);
		paramMap.put("ids", ids);
		dao.deleteTCMmFundsBorrowerBankactByPrimaryKey(paramMap);
	}

}

